<?php
if (!defined('THINK_PATH')) exit;
// 本文档自动生成，仅供测试运行
class showmodAction extends Action
{
	/**
	 +----------------------------------------------------------
	 * 默认操作
	 +----------------------------------------------------------
	 */
	public function index()
	{
		$mid = getRequest('modid');
		$mean = getRequest('mean');//用于子模块
		call_user_func(array($this,$mean),$mid);
		$moninfo = selectModel::getModInfoById($mid);
		$sonmod = selectModel::getAllSonModInfoById($mid);
		if(empty($sonmod)){
			$sonmod = selectModel::getAllSonModInfoById($moninfo['z_belong']);
		}
		$flag = $moninfo['z_belong'];
		while($flag>0){
			$info = selectModel::getModInfoById($flag);
			$first[] = $info;
			$flag = $info['z_belong'];
		}
		$p = new PublicAction();
		$p->recomment();
		krsort($first);
		$this->assign('mean',$mean);
		$this->assign('firstmod',$first);
		$this->assign('modinfo',$moninfo);
		$this->assign('sonmod',$sonmod);
		$this->display();
	}

	public function showmod(){
		return null;
	}
	public function showtit($mid){
		 $aritcles = selectModel::getAritcleTitByMid($mid);
		 $this->assign('titles',$aritcles);
	}
	public function article(){
		$tid = getRequest('tid');
		$article = selectModel::getAritcleInfoById($tid);
		$this->assign('article',$article);
	}
	public function product($mid){
		 $products = selectModel::getProductTitByMid($mid);
		 $this->assign('products',$products);
	}
	public function procon($pid){
		$pid = getRequest('pid');
		$content = selectModel::getProconInfoById($pid);
		$proattr = selectModel::getProattrInfoById($pid);
//		var_dump($content);
		$this->assign('content',$content);
		$this->assign('attr',$proattr);
	}
	public function content($mid){
		$content = selectModel::getModConInfoByMid($mid);
		$this->assign('content',$content);
	}
	public function msgboard($mid){
		$content = '<form action="'.__APP__.'?s=msgboard/addmsg" method="post">
<table class="tb tb2 ">
	<tbody>
		<tr onmouseover="setfaq(this, \'faq9fb4\')">
			<td s="1" class="td27" colspan="2">
				姓名:
			</td>
		</tr>
		<tr onmouseover="setfaq(this, \'faq9fb4\')" class="noborder">
			<td class="vtop rowform">
				<input type="text" class="txt" value="'.$upd['m_name'].'" name="name">
			</td>
			<td s="1" class="vtop tips2">
			</td>
		</tr>
		<tr onmouseover="setfaq(this, \'faqcbf1\')">
			<td s="1" class="td27" colspan="2">
				联系电话：
			</td>
		</tr>
		<tr onmouseover="setfaq(this, \'faqcbf1\')" class="noborder">
			<td class="vtop rowform" colspan="2">
				<input type="text" class="txt" value="'.$upd['m_phone'].'" name="phone">
			</td>
		</tr>
		<tr>
			<td s="1" class="td27" colspan="2">
				常用邮箱(email)：
			</td>
		</tr>
		<tr class="noborder">
			<td class="vtop rowform">
				<input type="text" class="txt" value="'.$upd['m_email'].'" name="email">
			</td>
			<td s="1" class="vtop tips2">
			</td>
		</tr>
		<tr onmouseover="setfaq(this, \'faq69ee\')">
			<td s="1" class="td27" colspan="2">
				意见及建议内容：
			</td>
		</tr>
		<tr onmouseover="setfaq(this, \'faq69ee\')" class="noborder">
			<td class="vtop rowform" colspan="2">
				<textarea class="tarea" cols="50" id="seodescriptionnew" name="content" rows="6">'.$upd['m_content'].'</textarea>
			</td>
		</tr>
		<tr>
			<td colspan="15">
				<div class="fixsel">
					<input type="submit" value="提交" title="按 Enter 键可随时提交您的修改" name="sub_msg" class="btn">
				</div>
			</td>
		</tr>
		<script type="text/JavaScript">
			
		</script>
	</tbody>
</table></form>';
		$this->assign('content',$content);
	}
	/*
	 +-----------------------------------------------------------
	 * 方法不存在时默认操作
	 +-----------------------------------------------------------
	 */
	public function _empty(){
		$this->redirect('error');
	}
	/*
	 +-----------------------------------------------------------
	 * 错误操作提示
	 +-----------------------------------------------------------
	 */
	public function error(){
		$this->display('./Tpl/default/Index/error.html');
	}
	/**
	 +----------------------------------------------------------
	 * 探针模式
	 +----------------------------------------------------------
	 */
	public function checkEnv()
	{
		load('pointer',THINK_PATH.'/Tpl/Autoindex');//载入探针函数
		$env_table = check_env();//根据当前函数获取当前环境
		echo $env_table;
	}

}
?>